package com.yy.service;

import com.yy.clientEntities.TestData;
import com.yy.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;

/**
 * Author young
 * Date 2023/1/4 22:08
 * Description: feign管理服务提供端接口
 */
@FeignClient(value = "nacos-producer-8020")
public interface FeignService {
    @GetMapping("nacos1/find/{id}")
    Result<TestData> findOne(@PathVariable("id") Integer id);

    @GetMapping("nacos1/all")
    Result<Collection<TestData>> all();

    @PutMapping("nacos1/add")
    Result<String> add(@RequestBody TestData testData);

    @PostMapping("naacos1/update")
    Result<TestData> update(@RequestBody TestData testData);

    @DeleteMapping("nacos1/delete/{id}")
    Result<String> delete(@PathVariable("id") Integer id);
}
